]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Bind "this" for various methods
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 11 Sep 2013 01:53:19 +0000 (21:53 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 11 Sep 2013 19:02:32 +0000 (15:02 -0400)
For extremely silly reasons with how the class framework works, the wrapper
method requires "this" to be bound in order for it to work, or else we'll
emit errors in strict mode.

https://bugzilla.gnome.org/show_bug.cgi?id=707892

js/ui/appDisplay.js
js/ui/status/network.js

index e0a4182a1853bcf72ecfbdd98f9a562d40a0fe78..6d4586e080ddb02a869b4d3843747d36b92b5b5f 100644 (file)
@@ -125,7 +125,7 @@ const BaseAppView = new Lang.Class({
     },
 
     loadGrid: function() {
-        this._allItems.sort(this._compareItems);
+        this._allItems.sort(Lang.bind(this, this._compareItems));
 
         for (let i = 0; i < this._allItems.length; i++) {
             let id = this._getItemId(this._allItems[i]);
index 879d7bfa133ad3845d1293a89af1f06e7e2aeae4..029c4ca906e7722ef0fe5d6b5cc3685221308e09 100644 (file)
@@ -244,7 +244,7 @@ const NMConnectionSection = new Lang.Class({
             this.emit('activation-failed', reason);
         }));
 
-        let pos = Util.insertSorted(this._connections, connection, this._connectionSortFunction);
+        let pos = Util.insertSorted(this._connections, connection, Lang.bind(this, this._connectionSortFunction));
         this._labelSection.addMenuItem(item.labelItem, pos);
         this._switchSection.addMenuItem(item.switchItem, pos);
         this._connectionItems.set(connection.get_uuid(), item);